package de.dnb.basics.filtering;

import de.dnb.basics.applicationComponents.RangeCheckUtils;

/**
 * Filterkriterium ENTHÄLT basierend auf String.contains().
 * 
 * @author Michael Inden
 * 
 * Copyright 2011 by Michael Inden 
 */
public class StringContains implements IPredicate<String> {
	private final String necessarySubstring;

	public StringContains(final String necessarySubstring) {
		RangeCheckUtils.assertReferenceParamNotNull("necessarySubstring",
			necessarySubstring);

		this.necessarySubstring = necessarySubstring;
	}

	@Override
	public final boolean accept(final String object) {
		return object.contains(necessarySubstring);
	}
}
